UNAME := $(shell uname)
CC := g++
CFLAGS := -Wall -g
INCLUDES := -I #add -I option (cur dir.) to compiler
LIBS := -lGL -lGLU -lglut
OBJECTS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))

ifeq ($(UNAME), Linux)
LINKER := -lGLU -lglut
else
LINKER := -lopengl32 -lGLU32 -lglut32
endif

all: $(OBJECTS)
	$(CC) -o main $(OBJECTS) $(LINKER)

%.o: %.cpp
	$(CC) $(INCLUDES) $(LIBS) $(CFLAGS) -c -o $@ $<

clean:
	-rm -f *o main main.exe

force:
	make clean
	make
